<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ tag import="java.util.List"%>
<%@ tag import="com.test.controller.CodeUtil"%>
<%@ tag import="com.test.model.BaseCode"%>
<%@ attribute name="name" type="java.lang.String" required="true"%>
<%@ attribute name="entityName" type="java.lang.String" required="true"%>
<%@ attribute name="value" type="java.lang.Object" required="false"%>
<%
	List<BaseCode> codeEntities = CodeUtil.getCodeEntity(entityName);
	request.setAttribute("codeEntities", codeEntities);
%>
<select name="${name}" class="form-control">
	<option value="" selected>请选择</option>
	<c:forEach items="${codeEntities}" var="entity">
		<option value="${entity.code}" <c:if test="${not empty value && entity.code == value}">selected</c:if>>
			${entity.name}</option>
	</c:forEach>
</select>